package com.liuzh.kaoyanspringboot.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.liuzh.kaoyanspringboot.entity.Message;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liuzh.kaoyanspringboot.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author 刘志鸿
 * @since 2023-03-22
 */
@Mapper
public interface MessageMapper extends BaseMapper<Message> {
    Page<Message> findPage(Page<Message> page, @Param("SNickname") String nickname, @Param("RNickname") String PNickname, @Param("type") String type);

    List<Integer> getReplyIdsByTypeAndUserId(@Param("type") String type,@Param("userId") Integer userId);

    List<Message> findByIsNew(@Param("isNew") boolean isNew, @Param("SNickname") String nickname, @Param("RNickname") String PNickname, @Param("type") String type);

    boolean oldBatchByIds(List<Integer> ids);

    List<User> findConcernMe(@Param("myId") Integer myId);
}
